home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14410 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
  2. From: grantp@usa.pipeline.com(Pete Grant)
  3. Newsgroups: comp.lang.c++,
  4. Subject: Re: How do you return values from in-line asm?
  5. Date: 30 Mar 1996 01:54:38 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4ji48u$oop@news1.h1.usa.pipeline.com>
  8. References: <4jh71e$iq8@newshost.centrum.is>
  9. NNTP-Posting-Host: 38.8.120.9
  10. X-PipeUser: grantp
  11. X-PipeHub: usa.pipeline.com
  12. X-PipeGCOS: (Pete Grant)
  13. X-Newsreader: Pipeline v3.5.0
  14.  
  15. On Mar 29, 1996 17:35:42 in article <Re: How do you return values from
  16. in-line asm?>, 'bjarnir@centrum.is (Bjarni Ragnarsson)' wrote: 
  17.  
  18.  
  19. >In article <4j9mab$19si@usenetp1.news.prodigy.com>, XKWR65B@prodigy.com
  20. (Mark  
  21. >Rubelmann) says: 
  22. >> When I try to use the function in  
  23. >>something like: 
  24. >> 
  25. >>     while(Get_Scan_Code==0) {} 
  26. >> 
  27. >>but it doesn't work, it just goes on to the next statement. Any help  
  28. >>would be appreciated. 
  29.  
  30. Bjarni gave an excellent explanation to the assembler coding. 
  31. I hope he doesn't mind my deleting it from this continuation as 
  32. my comment is on a different topic.   
  33.  
  34. Mark's code has another error.  Get_Scan_Code  
  35. is a function; therefore, parentheses are necessary:   
  36. while (Get_Scan_Code() == 0) {}. 
  37.  
  38. Unfortunately, the original code is legal syntax and the  
  39. compiler will accept it -- often without so much as a 
  40. warning.  The run time result is that the while condition 
  41. is never true and executin falls right through, as Mark  
  42. described. 
  43.  
  44. -- 
  45. Pete Grant 
  46. Kalevi, Inc. 
  47. Software Engineering & development
  48.